var t = null;
var m = 0;
var s = 0;
var index = 0;
t = setTimeout(time,1000);//开始执行
function time()
{
    index ++;
    clearTimeout(t);//清除定时器
    m = Math.floor(index / 60);
    s = index % 60;
/*    if(s == 60) {
        m = m + 1;
        s = 0;
    }*/
    if(m == 2) {
        document.getElementById("time").style.color = "red";
    }
    if(m == 3) {
/*        alert("hhh");*/
        window.location.reload();
    }

    if(s < 10 ) {
        s = "0" + s;
    }
    if(m < 10 ) {
        m = "0" + m;
    }

    document.getElementById("timespan").innerHTML = m+":"+s;
    t = setTimeout(time,1000); //设定定时器，循环执行
}